<template>
  <div class="">
    <!-- 1.路由的传参 -->

    <!-- <button @click="gotodetail(5)">gotodetail</button> -->
    <router-link :to="'/detail/' + id">gotodetail</router-link>
  </div>
</template>

<script>
export default {
  data() {
    return {
      id: 5,
    };
  },
  mounted() {},
  methods: {
    gotodetail(ids) {
      //   this.$router.push({ path: "/detail", query: { id: 5 } });
      // this.$router.push({ name: "detail", params: { id: 5 } });

      this.$router.push({ path: "/detail/" + ids });
    },
  },
};
</script>

<style lang="scss"></style>
